﻿using System.Data.Entity.ModelConfiguration;

namespace HobSoft.SoccerBet2014.Domain.Models.DbSchema
{
    public class OddsPriceConfiguration : EntityTypeConfiguration<OddsPrice>
    {
        public OddsPriceConfiguration(string schema = "dbo")
        {
            ToTable(schema + ".OddsPriceList");
            HasKey(op => new { op.BmID, op.OddsID, op.Type });
            HasRequired(o => o.Odds).WithMany(o => o.Prices).HasForeignKey(o => new { o.BmID, o.OddsID }).WillCascadeOnDelete();
            Property(o => o.Type).HasColumnName("Type").IsRequired();
            Property(o => o.Price).HasColumnName("Price").IsRequired();
            //Ignore(o => o.Odds);
            Ignore(o => o.MkType);
        }
    }
}
